<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddUserFields extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('lawyer', function(Blueprint $table) {
			$table->dropColumn('realname');
			$table->dropColumn('credit');
			$table->dropColumn('province');
			$table->dropColumn('city');
			$table->dropColumn('district');
			$table->dropColumn('address');
		});

	    // 增加
		Schema::table('user', function(Blueprint $table) {
			$table->string('nikname', 60)->nullable(); //昵称
			$table->string('sex')->nullable(); //身份证
			$table->string('marriage')->nullable(); // 性别
			$table->boolean('has_children')->nullable(); // 子女状况
			$table->string('education')->nullable(); // 最高学历
			$table->boolean('has_business')->nullable(); // 是否有自己的公司
			$table->string('industry')->nullable(); // 所在行业
		});
		Schema::table('lawyer', function(Blueprint $table) {
			$table->boolean('has_lawfirm')->nullable(); // 有无律师事务所
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('user', function(Blueprint $table) {
			$table->dropColumn('nikname');
			$table->dropColumn('sex');
			$table->dropColumn('marriage');
			$table->dropColumn('has_children');
			$table->dropColumn('education');
			$table->dropColumn('has_business');
			$table->dropColumn('industry');
		});
	}

}
